<%@ page import="Day528.DB" %>
<%@ page import="java.sql.ResultSet" %><%--
  Created by IntelliJ IDEA.
  User: 春风
  Date: 2023/5/28
  Time: 15:39
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>$Title$</title>
    <style>
        table {
            border-collapse: collapse;
            text-align: center;
            border-color: aqua;
        }
    </style>
</head>
<body>
<table border="1" width="500">
    <tr>
        <th>编号
        </th>
        <th>姓名
        </th>
        <th>性别
        </th>
        <th>操作
        </th>

                <%
        String sql = "select * from student";
        ResultSet rs = DB.query(sql);
        while (rs.next()) {
            int id = rs.getInt("id");
            String name = rs.getString("name");
            String sex = rs.getString("sex");
    %>

    <tr>
        <td><%=id%>
        </td>
        <td><%=name%>
        </td>
        <td><%=sex%>
        </td>
        <td><a href="/updateById?id=<%=id%>">修改</a><a href="deleteById?id=<%=id%>">删除</a></td>
    </tr>
    <%
        }
    %>


</table>
</body>
</html>
